package com.bauer.java.springboot.simpleapp.service;

import com.bauer.java.springboot.simpleapp.mapper.UserDao;
import com.bauer.java.springboot.simpleapp.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @description:
 * @author: weirui
 * @create: 2022-05-24 10:36
 **/
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    public User getUser() {
        return getById(1L);
    }

    @Transactional
    public User getById(Long id) {
        return userDao.selectByPrimaryKey(1L);
    }
}
